package com.usegoods.rabbitmqdelayedmessage.action;

import com.usegoods.rabbitmqdelayedmessage.service.provider.SendProcessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author usegoods@usegoods.com
 * @createTime 2020/8/29 10:55
 * @description
 */

@Slf4j
@RestController
@RequestMapping("send")
public class rabbitmqAction {

    @Autowired
    private SendProcessService sendDelayMsg;

    @GetMapping("/delayMsg")
    public void delayMsg2(String msg, Integer delayTime) {
        log.info("当前时间：{},收到请求，msg:{},delayTime:{}", new Date(), msg, delayTime);
        sendDelayMsg.sendDelayMsg(msg, delayTime);
    }
}
